﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtJSExtender.Controls
{
    #region RowSelectChanged EventHandler

    /// <summary>
    /// 行选择改变事件的参数
    /// </summary>
    public class RowSelectChangedEventArgs : EventArgs
    {
        public List<string> AllSelectedValues { get; set; }
        public List<string> CurrentPageSelectedValues { get; set; }
    }

    /// <summary>
    /// 行选择改变事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void RowSelectChangedEventHandler(Object sender, RowSelectChangedEventArgs e);

    #endregion

    #region RowCommand EventHandler

    public class RowCommandEventArgs : EventArgs
    {
        public string ActionName { get; set; }
        public int RowIndex { get; set; }
        public int ColumnIndex { get; set; }
        public Dictionary<string, object> RowData { get; set; }
    }

    public delegate void RowCommandEventHandler(Object sender, RowCommandEventArgs e);

    #endregion

    #region LoadPageData EventHandler

    public class LoadPageDataEventArgs : EventArgs
    {
        public GridDataStore DataStore { get; set; }

        public int CurrentPage
        {
            get;
            set;
        }

        public int PageSize
        {
            get;
            set;
        }

        public int TotalCount
        {
            get { return this.DataStore.TotalCount; }
            set { this.DataStore.TotalCount = value; }
        }

        public List<Dictionary<string, object>> Data
        {
            get { return this.DataStore.Data; }
            set { this.DataStore.Data = value; }
        }
    }

    public delegate void LoadPageDataEventHandler(Object sender, LoadPageDataEventArgs e);

    #endregion
}
